import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
const store = new Vuex.Store({
	state: {
		userInfo: null,
		projects: [],
		token: null
	},
	mutations: {
		saveToken(state, token) {
			state.token = token;
		},
		saveUserInfo(state, userInfo) {
			state.userInfo = userInfo;
		},
		saveProjects(state, data) {
			state.projects = data;
		},
		resetAll(state) {
			state.token = null;
			state.userInfo = null;
		}
	},
	actions: {

	},
	getters: {

	}
});
export default store;
